#ifndef CURVE_DOCK_WIN_H
#define CURVE_DOCK_WIN_H

////////////////////////////////////////
#include <QList>
#include <QWidget >
#include <QDockWidget>
#include <QColor>
#include "curveitem.h"

#define COLUMN_COUNT	(3)

class CurveitemDockWin : public QDockWidget
{
public:
	CurveitemDockWin(QWidget *parent, QwtPlot *plot);
	~CurveitemDockWin(void);
	CurveItem *findCurveByName(QString tag);
	QColor findUnsedCurveColor(void);
	void addCurve(CurveItem *curve);
	void delAllCurvePoint(void);
	int curveCount(void);
	CurveItem *getCurveAt(qint32 pos);
	QList<CurveItem *> getCurveList(void);
	void clearCurve(void);

private slots:
	void treeItemChanged(QTreeWidgetItem* item, int column);
	void updateParentItem(QTreeWidgetItem* item);
	void curveUpdateOnCheckChanged(CurveItem *curve);
	void on_itemClicked(QTreeWidgetItem *item, int column);

private:
	QwtPlot *m_parent_plot;
	QTreeWidget *m_treeWidget;
	QTreeWidgetItem *m_curve_head;
	QList<QColor> m_standby_color_list;
	QList<CurveItem *> m_curveitem_list;
};


#endif